const express = require('express');
const router = express.Router();
const {
  getRoomList,
  createRoom,
  joinRoom,
  leaveRoom,
  getRoomDetail,
  toggleReady,
  startGame,
  showBlackA,
  showRedA,
  playCards,
  passCards,
  getGameStatus,
  debugRooms,
  getRecentFriends
} = require('../controllers/gameController');

// 房间管理
router.get('/room/list', getRoomList);
router.post('/room/create', createRoom);
router.post('/room/join', joinRoom);
router.post('/room/leave', leaveRoom);
router.get('/room/detail', getRoomDetail);
router.post('/room/ready', toggleReady);

// 游戏操作
router.post('/start', startGame);
router.post('/show-black-a', showBlackA);
router.post('/show-red-a', showRedA);
router.post('/play', playCards);
router.post('/pass', passCards);
router.get('/status', getGameStatus);

// 好友功能
router.get('/friends/recent', getRecentFriends);

// 调试接口
router.get('/debug/rooms', debugRooms);

module.exports = router;
